--------------------------------------------------
-- Level code
-- Created 20:49 2021-1-28
--------------------------------------------------

local redCoins = require("Libraries/redCoins")
redCoins.ID = 103
redCoins.x = 642
redCoins.y = 66
redCoins.SeqSFX = "redCoins/sm64_red_coin_"
redCoins.SeqFormat = ".wav"

require("Libraries.nsmbwalls")

-- Run code on first frame of the world map
function onStart()
    --Your code here
end

-- Run code every frame (~1/65 second)
-- (code will be executed before game logic will be processed)
function onTick()
	for key, value in ipairs(NPC.get(97, -1)) do
		if not value.StoredY then
			value.StoredY = value.y
		end
		value.y = value.StoredY
	end
	for key, value in ipairs(NPC.get(196, -1)) do
		if not value.StoredY then
			value.StoredY = value.y
		end
		value.y = value.StoredY
	end
	if Level.winState() == 6 then
		Level.winState(1)
		-- SFX.play(19)
	end
end